this._client.connect('notify::manager-running', Lang.bind(this, this._syncNMState));
this._client.connect('notify::networking-enabled', Lang.bind(this, this._syncNMState));
this._client.connect('notify::state', Lang.bind(this, this._syncNMState));
- this._client.connect('notify::active-connections', Lang.bind(this, this._updateIcon));
+ this._client.connect('notify::active-connections', Lang.bind(this, this._syncActiveConnections));
this._client.connect('device-added', Lang.bind(this, this._deviceAdded));
this._client.connect('device-removed', Lang.bind(this, this._deviceRemoved));
this._settings.connect('new-connection', Lang.bind(this, this._newConnection));
let a = this._activeConnections[i];
if (!a._inited) {
- a._notifyDefaultId = a.connect('notify::default', Lang.bind(this, this._updateIcon));
- a._notifyDefault6Id = a.connect('notify::default6', Lang.bind(this, this._updateIcon));
+ a._notifyDefaultId = a.connect('notify::default', Lang.bind(this, this._syncActiveConnections));
+ a._notifyDefault6Id = a.connect('notify::default6', Lang.bind(this, this._syncActiveConnections));
a._notifyStateId = a.connect('notify::state', Lang.bind(this, this._notifyActivated));
a._inited = true;
if (this._mainConnection) {
let dev = this._mainConnection._primaryDevice;
this._mainConnectionIconChangedId = dev.connect('icon-changed', Lang.bind(this, this._updateIcon));
+ this._updateIcon();
}
},
activeConnection._primaryDevice._notification = null;
}
- this._updateIcon();
+ this._syncActiveConnections();
},
_ignoreConnection: function(connection) {
_newConnection: function(settings, connection) {
this._addConnection(connection);
- this._updateIcon();
+ this._syncActiveConnections();
},
_connectionRemoved: function(connection) {
}
this._showNormal();
- this._updateIcon();
+ this._syncActiveConnections();
},
_updateIcon: function() {
- this._syncActiveConnections();
let hasApIcon = false;
let hasMobileIcon = false;